import { http } from "@/utils/http";
import type { RequestResponse } from "./types";

export const homeApi = {
  // 获取首页概览数据
  getHomesummaryData: (data: params) => {
    return http.request<RequestResponse<HomeSummaryVO>>(
      "post",
      "/api/v1/hdl/app/doctor/home/summary",
      { data }
    );
  },
  getHealthCategorySummary: () => {
    return http.request<RequestResponse<HomeHealthCategoryVO[]>>(
      "get",
      "/api/v1/hdl/app/doctor/home/healthCategory/summary"
    );
  },
  getHealthTagSummary: () => {
    return http.request<RequestResponse<HomeHealthTagVO[]>>(
      "get",
      "/api/v1/hdl/app/doctor/home/healthTag/summary"
    );
  },
  getHealthCategoryDetail: (id: { healthCategoryId: number }) => {
    return http.request<RequestResponse<usename[]>>(
      "get",
      "/api/v1/hdl/app/doctor/home/healthCategory/detail",
      { params: id }
    );
  },
  getHealthTagDetail: (p: { healthTagId: number; archiveTime: string }) => {
    return http.request<RequestResponse<usename[]>>(
      "get",
      "/api/v1/hdl/app/doctor/home/healthTag/detail",
      { params: p }
    );
  }
};
interface params {
  endDate: number;
  /**
   * 开始时间（毫秒时间戳）
   */
  startDate: number;
}
export interface HomeSummaryVO {
  /**
   * 处理档案数
   */
  archiveCount?: number;
  /**
   * 高管用户
   */
  executiveUserCount?: number;
  /**
   * 家属
   */
  familyUserCount?: number;
  /**
   * 随访数
   */
  followUpCount?: number;
  /**
   * 体检数
   */
  healthCheckCount?: number;
  /**
   * 处理报告和档案数
   */
  reportAndArchiveCount?: number;
  /**
   * 处理报告数
   */
  reportCount?: number;
  /**
   * 处理任务数
   */
  taskCount?: number;
  /**
   * 服务总人数
   */
  totalServiceCount?: number;
  /**
   * 疫苗数
   */
  vaccineCount?: number;
  [property: string]: any;
}
/**
 * ResponseDTOListHomeHealthCategoryVO
 */

/**
 * HomeHealthCategoryVO
 */
export interface HomeHealthCategoryVO {
  /**
   * 健康分类下的用户数量
   */
  count?: number;
  /**
   * 健康分类ID
   */
  healthCategoryId?: number;
  /**
   * 健康分类名称
   */
  healthCategoryName?: string;
  /**
   * 健康分类,占百分比
   */
  percent?: number;
  [property: string]: any;
}
/**
 * ResponseDTOListHomeHealthTagVO
 */

/**
 * HomeHealthTagVO
 */
export interface HomeHealthTagVO {
  /**
   * 档案时间（格式:2025-08）
   */
  archiveTime?: string;
  /**
   * 健康标签详情
   */
  tagList?: HomeHealthTagDetail[];
}

/**
 * com.hdl.app.module.doctor.domain.home.HomeHealthTagVO.HomeHealthTagDetail
 *
 * HomeHealthTagDetail
 */
export interface HomeHealthTagDetail {
  /**
   * 健康标签数
   */
  count?: number;
  /**
   * 健康标签ID
   */
  healthTagId?: number;
  /**
   * 健康标签名称
   */
  healthTagName?: string;
  [property: string]: any;
}
export interface usename {
  userId?: number;
  /**
   * 用户姓名
   */
  userName?: string;
  [property: string]: any;
}
